<template>
  <div class="app">
    <router-view :key="$route.fullPath">
      <Index/>
    </router-view>
  </div>
</template>

<script>
import Index from '@views/index/index.vue';

export default {
  name: "App",
  components: {Index},
  data() {
    return {}
  },
  created() {
    this.checkRunEnv();
  },

  mounted() {
    // throw new Error("测试错误监控");
  },
  methods: {
    checkRunEnv() {
      const {hostname, port, protocol} = window.location;
      if (protocol === 'file:' || !hostname || !port) {
        let msg = "请将项目放置到服务器中运行，或者本地开启一个服务运行项目！！！";
        console.error(msg);
        this.$message.error(msg);
      }
    },
  }
}
</script>

<style lang="scss">
@import "index.css";

/*@media screen and (min-width: 540px) {
  html, body {
    width: 375px !important;
    height: 100vh !important;
    margin: 0 auto;
  }
}*/

.show-border {
  border: 1px solid red;
}

.strike {
  text-decoration: line-through;
}

.center-h {
  display: flex;
  justify-content: center;
}

.center-v {
  display: flex;
  align-items: center;
}

.center-h-v {
  display: flex;
  justify-content: center;
  align-items: center;
}


</style>


